import Qt 4.7

Image{
    id: buttonTemplate
    property string buttonImage: "toLeft.png"
    signal clicked
    source: buttonImage;
    MouseArea {
        id: mouseArea
        anchors.fill: parent
        onClicked: {
            buttonTemplate.clicked();
        }
    }
    Rectangle {
            id: shade
            anchors.fill: buttonTemplate; radius: 10; color: "black"; opacity: 0
        }
    states: State {
        name: "pressed"; when: mouseArea.pressed == true
        PropertyChanges { target: shade; opacity: .5 }
    }
    transitions: [
        Transition {
            from: ""
            to: "pressed"
            ParallelAnimation {
                PropertyAnimation { target: shade; properties: "opacity"; duration: 200}
            }
        }
    ]
}
